<%@ page import="top.lionkliu.service.impl.NoteServiceImpl" %>
<%@ page import="top.lionkliu.service.UserService" %>
<%@ page import="top.lionkliu.service.impl.UserServiceImpl" %>
<%@ page import="top.lionkliu.entity.User" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<html>
<head>
    <title>修改用户信息</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="../static/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" href="../static/bootstrap/css/bootstrap.min.css">

    <script src="../static/js/jquery.js"></script>
    <script src="../static/bootstrap/js/bootstrap.js"></script>
</head>
<body>

<%@include file="../common/NavBar.jsp"%>
<div class="container" style="margin: 20px auto;">

    <h2>修改用户信息</h2>
        <form action="<%=request.getContextPath()%>/user/edit" method="post">
            <%
                String queryString = request.getQueryString();
                String id = queryString.substring(3);
                session.setAttribute("userId", id);
                UserServiceImpl userService = new UserServiceImpl();
                User user = userService.selectById(Integer.parseInt(id));
            %>
            用户名:<input type="text" name="name" class="form-control col-4" id="name" value="<%=user.getName()%>">
            邮箱:<input type="text" name="email" class="form-control col-4" id="email"  value="<%=user.getEmail()%>">
            密码：<input type="text" name="pwd"  class="form-control col-4" id="inputPassword" value="<%=user.getPassword()%>">
            头像地址：<input type="text" name="img"  class="form-control col-4" id="inputPassword" value="<%=user.getImage()%>">

            用户权限：
            <select class="form-control  col-4" name="identity">
                <option value="<%=SystemConstants.IS_USER%>">普通用户</option>
                <option value="<%=SystemConstants.IS_ADMIN%>">管理员</option>
            </select></br>
<%--            <div class="form-group row">--%>
<%--                <label for="image" class="col-sm-2 col-form-label">头像:</label>--%>
<%--                <div class="col-sm-7">--%>
<%--                    <input type="text" name="image"  class="form-control" id="image" value="<%=user.getImage()%>">--%>
<%--                </div>--%>
<%--            </div>--%>
            <button type="submit" class="btn btn-primary col-4">修改</button>
        </form>
</div>
</body>
</html>
